//
//  BaseViewController.m
//  Bubble
//
//  Created by A-01 on 2020/6/18.
//  Copyright © 2020 Mac. All rights reserved.
//

#import "BaseViewController.h"

@interface BaseViewController ()


@end

@implementation BaseViewController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];

    [self.navigationController setNavigationBarHidden:YES animated:YES];

}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = [UIColor colorWithHexString:@"6FB7FF"];
    
    UIButton * backButton = [[UIButton alloc] init];
    
    [backButton setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal];
    [backButton addTarget:self action:@selector(clickBackButton) forControlEvents:UIControlEventTouchUpInside];
    
    self.backButton = backButton;
    
    [self.view addSubview:self.backButton];
}

- (void)clickBackButton{

    [self.navigationController popViewControllerAnimated:YES];
}


- (void)viewDidLayoutSubviews{
    
    [self.backButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.view).offset(60);
        make.top.mas_equalTo(self.view).offset(20);
        make.width.mas_equalTo(68);
        make.height.mas_equalTo(36);
    }];
    
}


@end
